window.addEventListener('load', function () {
    let select = document.querySelector('.select')
    let optionList = document.querySelector('.options-list')
    let options = document.querySelectorAll('.option')

    select.addEventListener('click', function () {
        optionList.classList.toggle('active')
        // select.querySelector('.angle-down').classList.toggle('angle-up')
    })

    options.forEach(function (option) {
        option.addEventListener('click', function () {
            options.forEach(function (opt) {
                opt.classList.remove('selected')
                select.querySelector('span').innerHTML = option.innerHTML
                opt.classList.add('selected')
                optionList.classList.toggle('active')
                // select.querySelector('.angle-down').classList.toggle('angle-up')
            })
        })
    })
})